<script>
import {defineComponent} from 'vue'

export default defineComponent({
    name: "Child",
    // 数组
    // props:["age","userName"],

    // 对象
    // props:{
    //     age:Number,
    //     userName:String
    // },

    // 对象
    props: {
        userName: {
            type: String
        },
        age: {
            type: Number
        },
        sex: {
            type: String,
            default:"男"
        },
        hobby:{
            type:String,
            required:true
        }
    },
    mounted() {
        console.log(this);
    }
})
</script>

<template>
    <div>
        <h3>Child</h3>
        <p>userName:{{ userName }}</p>
        <p>age:{{ age }}</p>
        <p>sex:{{ sex }}</p>
        <p>hobby:{{ hobby }}</p>
    </div>
</template>

<style scoped>

</style>